home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / mac / hfpcktrn.hqx / HF Packet tutor / hf_packet.txt < prev    next >
Text File  |  1993-06-28  |  18KB  |  341 lines

  1.                A BRIEF TUTORIAL ON HF PACKET OPERATION
  2.                        by Norm Sternberg, W2JUP
  3.  
  4. 1.   TNC PARAMETER VALUES
  5.  
  6.      RULE 1: DON'T USE THE FACTORY DEFAULTS IN YOUR TNC 
  7.     
  8.      The values stored in your TNC's EPROMs are totally unsuitable for HF 
  9.      packet operation; they are tailored for the average VHF case.  Here is a 
  10.      set of recommended "non-default" parameter values for general purpose HF 
  11.      operation on 40, 20 and 15 meter packet operation. 
  12.          
  13.           MAXFRAME 1 to 2 
  14.           PACLEN 32, 64 or 80
  15.           TXDELAY 40 or 50
  16.           FRACK 6, 7 or 8
  17.  
  18.      MAXFRAME
  19.  
  20.      Choose a lower setting for poor conditions, a higher value for better 
  21.      conditions.  We have very strong mathematical and experimental evidence 
  22.      (papers by Phil Karn and others) that MAXFRAME 1 provides better long-
  23.      term throughput even on VHF!
  24.  
  25.      If you send FOUR frames in one packet and the distant station ACKs only 
  26.      frame #1, then you're going to resend frames #2, #3, and #4.  If he ACKs 
  27.      frames #2, #3 and #4 but bombs #1, you're going to resend all four of 
  28.      them again anyway.  What's the point in cluttering the channel with two, 
  29.      three or four un-ACK'ed frames when the first one hasn't been accepted?  
  30.  
  31.      Each frame imposes a fixed "overhead" on the packet.  This "overhead" is 
  32.      the synchronization, timing, clocking, control and address information 
  33.      stuff that you DON'T type; the stuff that makes the protocol work.  The 
  34.      simplest frame you can send has at least 19 bytes (152 bits) of overhead.  
  35.      Each BIT of each BYTE is tested by the error correction process. 
  36.  
  37.      Unless you have a definite need to maintain a specific document format, 
  38.      don't waste bandwidth inserting blank lines because you think it may 
  39.      "look good" on the other station's screen.  If you're operating in the 
  40.      CONVERSE mode as most people tend to do, your packet frame is actually 
  41.      sent by the CARRIAGE RETURN or ENTER key. 
  42.  
  43.      That single CR/LF you type to make a blank line creates a frame that has 
  44.      exactly the same overhead as a frame that has 80 typed characters.  This 
  45.      "overhead" is the packet protocol stuff like the sync, callsigns and con-
  46.      trol information - stuff that you don't see, that conveys no "user" in-
  47.      formation.  Every blank line must be ACK'ed just the same as the fully 
  48.      typed lines.  (It hurts to see a link time out retrying a blank line.) 
  49.      
  50.      PACLEN
  51.  
  52.      Choose a lower setting for poor conditions, a higher value for better 
  53.      conditions. 
  54.      
  55.      This is the number of typed characters that makes ONE frame.  The lower 
  56.      the number of characters or bytes in the frame, the higher the mathemat-
  57.      ical probabilities of getting through without taking a hit.
  58.  
  59.      Each byte in the overhead mentioned above has eight bits.  Each of the 
  60.      characters you type has eight bits.  If any one of those bits in any one 
  61.      of those overhead bytes (or in your typed characters) takes a noise hit, 
  62.      then the error correction process fails, and the whole frame is thrown 
  63.      away.  
  64.  
  65.      Let's say that W2JUP is directly connected to W2HPM and sends the simple 
  66.      line:
  67.  
  68.           Hello, Joe, how are you?>>
  69.  
  70.      That small packet frame actually consists of at least 20 bytes (160 bits) 
  71.      of overhead, plus 27 bytes (208 bits) of your typed data, a total of 376 
  72.      bits.  If any one of those 376 individual bits is trashed at any point in 
  73.      the link during transmission, then the entire frame is thrown away by the 
  74.      receiving station. 
  75.  
  76.      Now let's assume that you're still using the factory-default value of 
  77.      PACLEN, 128 bytes, and that you're NOT typing any CR/LF so that your TNC 
  78.      is automatically sending the packet at your 129th typed character.  Your 
  79.      frame might look like this: 
  80.  
  81.      Joe, I wanted to let you know that I wouldn't be able to go to the club 
  82.      meeting tomorrow night and you'll have to get a ride from
  83.  
  84.      The same simple arithmetic tells us that you've just sent 20 bytes of 
  85.      overhead, plus 128 bytes of the characters you've typed, resulting in a 
  86.      frame that has 20 + 128 * 8 = 1184 bits.  
  87.  
  88.      Simple common sense says that the chances of getting 1184 bits through 
  89.      the link "unharmed" - are much lower than getting only 376 bits through 
  90.      without damage by the typical noisy HF radio environment.  Now - if you 
  91.      happen to be operating with the factory-default settings (as your TNC is 
  92.      shipped from the factory): 
  93.  
  94.           MAXFRAME 4 
  95.           FRACK 3 
  96.           PACLEN 128 
  97.  
  98.      Let's look at MAXFRAME first.  Arithmetic tells us that you've just sent 
  99.      a packet of FOUR frames, each one containing 1184 bits, totalling 4736 
  100.      bits. The chance of ALL 4736 bits surviving the journey in typical HF 
  101.      conditions is a wee bit small.
  102.  
  103.      We're limited by Part 97 to a maximum 300 bit-per-second data rate on HF 
  104.      packet.  At 300 bits per second, each BIT of each BYTE (or character) has 
  105.      a duration of 3.3 milliseconds.  You can see that it doesn't take much of 
  106.      a noise pulse to smear one of those many bits and thereby kill an entire 
  107.      frame.  Have you ever measured the length of a single pulse from either 
  108.      the "Woodpecker" or your local power line noise? 
  109.  
  110.      Now, let's look at FRACK.  The FRACK timer sets the amount of time that 
  111.      your TNC will wait for an ACK after the instant your PTT keys your rig.  
  112.      Contrary to a common misunderstanding, FRACK time is NOT counted from the 
  113.      end of your burst; it's counted from the beginning. 
  114.  
  115.      Let's assume you're still using the factory supplied default values 
  116.  
  117.           FRACK 3 (3 seconds) 
  118.           TXDELAY 30 (300 milliseconds).  
  119.  
  120.      Let's say that you send our sample short line shown above:
  121.  
  122.           Hello, Joe, how are you?>> 
  123.  
  124.      That packet frame contains 376 bits of stuff.  More arithmetic:
  125.  
  126.           376 bits @ 300 bits per second    = 1.25 seconds
  127.                300 milliseconds TXDELAY     = 0.30 seconds
  128.                            Length of burst  = 1.57 seconds
  129.                      minus FRACK delay      = 3.00 seconds
  130.          Available response window for ACK  = 1.47 seconds
  131.  
  132.      This appears to be logically possible - but is it really?  Is this 
  133.      enough time for the other station to send you the ACK you need?
  134.  
  135.      The other station's TNC must send an ACK whose minimum length will be 20 
  136.      bytes or 376 bits.  If he's using a slightly lengthened TXDELAY (say 400 
  137.      milliseconds, a longish DWAIT of 320 milliseconds, a RESPTIME of 5 (500 
  138.      milliseconds), or if his TNC hears anything on the channel and delays the 
  139.      ACK for even a few hundred milliseconds, we have an interesting problem. 
  140.  
  141.      Let's assume that the other station's TNC received a valid frame from 
  142.      your system, the channel is clear, and his TNC is going to send the ACK 
  143.      back to you.  Now we've got a very cute "CATCH-22" situation: 
  144.  
  145.           376 bits @ 300 bits per second    = 1.25 seconds
  146.           Distant station's TXDELAY         = 0.40 seconds
  147.           Distant station's DWAIT           = 0.32 seconds
  148.           Distant station's RESPTIME        = 0.50 seconds
  149.  
  150.       TOTAL DELAY before other station's end-of-data  = 2.47 seconds
  151.  
  152.      Remember that your system won't know if his ACK is valid until your TNC 
  153.      has received and decoded his entire frame.  The combined delays intro-
  154.      duced at his end now approach your FRACK time.  You can't decode and val-
  155.      idate his ACK before your FRACK timer runs out.  Your TNC RETRYs your 
  156.      frame because the other station's ACK didn't arrive on time.  And all 
  157.      this relates to his sending an ACK frame of only 20 bytes.
  158.  
  159.      Now that we've had a taste of timing concepts, let's see why HF packet 
  160.      doesn't work and what happens if you're still using the factory-default 
  161.      values:
  162.  
  163.           MAXFRAME 4 
  164.           PACLEN 128
  165.           FRACK 3
  166.  
  167.      Our arithmetic said that you would send a packet of four frames, each one 
  168.      containing 1184 bits, totalling 4736 bits.
  169.  
  170.           4736 bits @ 300 bits per second   =  15.79 seconds 
  171.           300 milliseconds TXDELAY          =   0.30 seconds
  172.                            Length of burst  =  16.09 seconds
  173.                            FRACK delay      =   3.00 seconds
  174.          Available response window for ACK  = minus 13.09 seconds
  175.  
  176.      You cannot fit a 16-second burst into a 3-second FRACK window.  Your 
  177.      FRACK timer expires before you've finished sending the packet!  This is 
  178.      not going to work!  
  179.  
  180.      Now, let's use the same arithmetic to see how our suggested values fit in 
  181.      here. 
  182.  
  183.           MAXFRAME 1 (Only ONE un-ACK'ed frame allowed on the air) 
  184.           PACLEN 64  ((64 * 8) + (20 * 8))  = 672 bits 
  185.           FRACK 6    (6 seconds) 
  186.           672 bits @ 300 bits per second    =  2.24 seconds
  187.                   300 milliseconds TXDELAY  =  0.30 seconds
  188.                            Length of burst  =  2.54 seconds
  189.                               FRACK delay   =  6.00 seconds
  190.        Available response window for ACK    =  3.46 seconds
  191.  
  192.      This will work.  Your single frame packet burst of 20 bytes of overhead 
  193.      and 64 bytes of your typed data adds up to about 2.5 seconds.  About 3.5 
  194.      seconds remain available as the interval during which you must receive 
  195.      the ACK from the other guy before your TNC will retry the frame. 
  196.  
  197.      Below 28 MHz you're limited to 300 bits per second.  On VHF you've been 
  198.      using 1200 bits per second.  Everything on HF takes FOUR TIMES LONGER to 
  199.      send, and FOUR TIMES LONGER to receive. 
  200.  
  201.      TXDELAY
  202.  
  203.      Don't assume that TXDELAY relates ONLY to your radio's switching times.  
  204.      It also relates to the switching and other timing factors in the other 
  205.      station's radio.  In our real world of HF packet radio, TXDELAY relates 
  206.      to the radios at both ends of the link.
  207.  
  208.      Nearly all phase-locked-loop synthesized radios have some measureable 
  209.      "settling time".  This delay is introduced by some PLL frequency setting 
  210.      systems when switching from transmit mode to receive mode and vice-versa.  
  211.      We also note that many HF transceivers have a significant delay - even 
  212.      with "fast" AGC.  This additional delay occurs while the receiver's AGC 
  213.      circuit is "relaxing" and returning the receiver to full sensitivity.
  214.  
  215.      One more cause of delays appears when the sending station uses AFSK in 
  216.      the single-sideband mode.  Some operators are not careful to avoid 
  217.      driving the transmitter into ALC action.  ALC (Automatic Level Control) 
  218.      tends to reduce the transmitter's power output at keyup time and, if 
  219.      excessive, can actually destroy the first few bytes of the transmitted 
  220.      packet frame.  Those first bytes of each packet frame are the FLAG field, 
  221.      the information that marks the beginning of the frame and provides timing 
  222.      or synchronization information to the other station's TNC.  If the flag 
  223.      is smeared during transmission, the receiving TNC can't use that frame 
  224.      and throws away whatever it receives after it.  In addition, the more 
  225.      sync you have on the front of each frame, the higher the probability that 
  226.      the other station's TNC will successfully decode your frame in conditions 
  227.      of noise and propagation effects.  
  228.  
  229.      Extra flag also seems to help combat the effects of multipath and select-
  230.      ive fades.  Don't fall for that "Too much TXD cuts down my throughput" 
  231.      nonsense.  If the other station doesn't decode your flag correctly, then 
  232.      all the bytes after the sync are trashed; the frame is thrown away.  So 
  233.      much for your "throughput".
  234.  
  235. 2.  FREQUENCY CONTROL AND STABILITY
  236.  
  237.      RULE 2: HF PACKET DEMANDS PRECISE OPERATING FREQUENCY CONTROL!!
  238.  
  239.      You've operated VHF packet without problems, so you've probably ignored 
  240.      your TNC's transmitted tones and calibration.  You've probably devoted 
  241.      the same benevolent neglect towards your TNC's demodulator calibration.  
  242.      You connect to your buddies and to the local BBS; your rule has been "if 
  243.      it ain't broke, don't fix it". 
  244.  
  245.      On FM, the the tones you receive are directly generated and controlled in
  246.      the other station's TNC and vice-versa.  Your TNC's tones are transmitted 
  247.      directly, unaltered, by your FM transmitter and received unaltered by the 
  248.      other station's receiver.  Your synthesized radio's LED frequency display 
  249.      tells you you're on the same frequency as the other station.
  250.  
  251.      But HF packet is a different story.  The tones produced by your TNC may 
  252.      no longer be the same tones that come out of the other station's radio.  
  253.      The frequency of the tones recovered from the other station's receiver 
  254.      depend on how the other station's operator tunes his receiver.  Whether 
  255.      you and the other station are using AFSK or direct FSK, the tones from 
  256.      the receiver will always be determined by receiver frequency tuning.  
  257.  
  258.      Tuning accuracy on HF packet radio is generally more critical than in the 
  259.      other operating modes.  Tuning errors as small as 20 Hz can result in 
  260.      failure to decode packets successfully.  The more selective the receiver 
  261.      and the TNC's filters, the more critical the tuning accuracy.  Some IF 
  262.      filters can be too narrow to handle data at our usual HF packet rate of 
  263.      300 bits per second.  In general, IF filter bandwidths should be greater 
  264.      than 500 Hz for packet operation at 300 bits per second.  
  265.  
  266.      HF packet operation also imposes greater demands for overall transmitter 
  267.      and receiver stability.  Unless the rig can hold frequency, plus or minus 
  268.      20 or 30 Hz for more than just a few minutes, you may drift right out of 
  269.      a useable HF link and "die" from excessive retrys.
  270.  
  271.      There are other interesting problems.  Unlike conventional Baudot, ASCII 
  272.      RTTY and AMTOR, packet signals use a data format called NRZI (non-return-
  273.      -to-zero-inverted), which in effect ignores data sense (mark-space polar-
  274.      ity).  On HF packet, you can use upper sideband or lower sideband equally 
  275.      well.  The only difference will be in the frequency shown on your rig's 
  276.      tuning display.  You can be on USB while your link partner can be on LSB.  
  277.      Your rigs will appear to be on different frequencies.  In general, most 
  278.      stations using AFSK tend to operate on LSB.  It's best to use the same 
  279.      sideband as the station you're working.
  280.  
  281.      To set up a schedule, or connect to a PBBS, or link in a network system, 
  282.      you can't always go strictly by the frequency displayed by most modern HF 
  283.      rigs.  There is no industry-wide standard as to the exact meaning of the 
  284.      numbers shown.  Some transceivers display the frequency of the suppressed 
  285.      carrier in SSB; some show the frequency when your rig is tuned to Mark 
  286.      (lower) tone, some show tuning for Space (higher) tone.  Some HF rigs 
  287.      even provide front-panel adjustment of the digital display to whatever 
  288.      the user wishes; carrier, USB, LSB, FSK either tone, etc.  
  289.  
  290.      For the AFSK packet operator, this situation is somewhat complicated by 
  291.      the lack of an industry-wide standard for HF Mark and Space tones.  AEA's 
  292.      PK-64 and PK-232 TNCs use 2110 Hz as Mark and 2310 Hz as Space, about in 
  293.      the same range as the traditional RTTY tones at 2125 and 2295 Hz (plus 
  294.      and minus 15 Hz).  
  295.  
  296.      Most licensed clones of the TAPR TNC-2 (including the AEA PK-80) use 1650 
  297.      and 1850 Hz for Mark and Space respectively.  TNCs using the AMD7910 
  298.      "World Chip" modem (including AEA's PK-87 and PK-88) provide a choice of 
  299.      1075 Mark and 1275 Space, or 2025 Mark and 2225 Space.
  300.  
  301.      When using AFSK, your rig's displayed frequency will literally depend on 
  302.      the tones being transmitted by the distant station, and also on the fre-
  303.      quencies to which your TNC's demodulator and filters are tuned.  Check 
  304.      your TNC and transceiver operating manuals to determine what audio tones 
  305.      your TNC uses for Mark and Space, and how your rig's digital display re-
  306.      lates to the received and transmitted frequencies.
  307.  
  308.      There are some subtle problems in HF packet radio.  You may see lots of 
  309.      interesting packet signals, send repeated connect requests - and nothing! 
  310.      You check your timing parameters; they're all what they should be.  You 
  311.      set AGC to "FAST", you verify that "ALC" is not active.  VOX is turned 
  312.      off, the rig is putting out power, the antenna is connected, everything 
  313.      appears "normal - and still nothing!  What can be wrong here?
  314.  
  315.      You've probably assumed that your rig is receiving and transmitting on 
  316.      the same frequency shown by your digital display.  This is not always 
  317.      true!  Some of the most-recent HF transceivers seem to have as much as 
  318.      200 Hz difference between the receive and transmit frequencies.  This is 
  319.      enough to guarantee your inability to establish and maintain a decent 
  320.      packet link.  Don't assume anything!  Be prepared to tweak your RIT/XIT 
  321.      controls to make the link work.  Be prepared to recalibrate your rig's
  322.      reference oscillators if neede.  You may require either a good counter or 
  323.      a patient partner to determine how your rig is behaving and if you're 
  324.      really sending and receiving on the same frequency.  
  325.  
  326. 3.   CONCLUSIONS
  327.  
  328.      You too can work HF packet successfully.  Remember these general 
  329.      principles:
  330.  
  331.      o    Assume nothing
  332.      o    Take nothing for granted
  333.      o    Check everything twice
  334.      o    Recognize that there are major operational differences between VHF 
  335.           and HF packet radio.
  336.      o    Remember the two most-critical factors for success on HF packet:
  337.  
  338.           TIMING and TUNING
  339.  
  340. /30
  341. W2JUP